import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    component: () => import('../views/home.vue'),
    //配置二级路由
    children:[
      {
        path: '/erjia',
        name: 'erjia',
        component: () => import('../views/erji/erjia.vue')
      },
      {
        path: '/erjib',
        name: 'erjib',
        component: () => import('../views/erji/erjib.vue')
      },
      {
        path: '/erjic',
        name: 'erjic',
        component: () => import('../views/erji/erjic.vue')
      },
      {
        path: '/erjid',
        name: 'erjid',
        component: () => import('../views/erji/erjid.vue')
      },
      {
        path: '/erjie',
        name: 'erjie',
        component: () => import('../views/erji/erjie.vue')
      },
      {
        path: '/erjif',
        name: 'erjif',
        component: () => import('../views/erji/erjif.vue')
      },
      {
        path:"/",
        redirect:"/erjic"
      }
    ]
  },

  {
    path: '/watch',
    name: 'watch',
    component: () => import('../views/watch.vue'),
    children:[
      {
        path: '/eer1',
        name: 'eer1',
        component: () => import('../views/er3/eer1.vue')
      },
      {
        path: '/eer2',
        name: 'eer2',
        component: () => import('../views/er3/eer2.vue')
      },
      {
        path: '/eer3',
        name: 'eer3',
        component: () => import('../views/er3/eer3.vue')
      },
      {
        path: '/eer4',
        name: 'eer4',
        component: () => import('../views/er3/eer4.vue')
      },
      {
        path: '/eer5',
        name: 'eer5',
        component: () => import('../views/er3/eer5.vue')
      },
      {
        path:"/",
        redirect:"/eer2"
      }
    ]
  },
  {
    path: '/news',
    name: 'news',
    component: () => import('../views/news.vue')
  },
  {
    path: '/follow',
    name: 'follow',
    component: () => import('../views/follow.vue'),
    children:[
      {
        path: '/era',
        name: 'era',
        component: () => import('../views/er2/era.vue')
      },      
      {
        path: '/erb',
        name: 'erb',
        component: () => import('../views/er2/erb.vue')
      },      
      {
        path: '/erc',
        name: 'erc',
        component: () => import('../views/er2/erc.vue')
      },
      {
        path:"/",
        redirect:"/era"
      }
    ]
  },
  {
    path: '/mypage',
    name: 'mypage',
    component: () => import('../views/mypage.vue')
  },
  {
    path: '/all1zi',
    name: 'all1zi',
    component: () => import('../components/all1zi.vue')
  },
  {
    path: '/all2',
    name: 'all2',
    component: () => import('../views/all2.vue')
  },
  {
    path: '/den',
    name: 'den',
    component: () => import('../components/den.vue')
  },
  {
    path: '/zhu',
    name: 'zhu',
    component: () => import('../components/zhu.vue')
  },
  {
    path: '/nelizi',
    name: 'nelizi',
    component: () => import('../components/nelizi.vue')
  },
  //设置重定向
  {
    path:"/",
    redirect:"/home"
  }
]

const router = new VueRouter({
  // mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
